package com.gitee.zhanyao.web.controller;

import com.gitee.zhanyao.web.properties.PageProperties;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class IndexController {

    private final PageProperties pageProperties;

    public IndexController(PageProperties pageProperties) {
        this.pageProperties = pageProperties;
    }

    @GetMapping("/")
    public String index() {
        return "redirect:" + pageProperties.getIndex();
    }

    @GetMapping("/index1")
    public String index1() {
        return "index1";
    }

    @GetMapping("/index2")
    public String index2() {
        return "index2";
    }

}
